feat(projects): implement project center and asset library - #119
Conversation
Projects need a domain adapter for the backend contract in PR 75. Map project DTOs, enums, pagination queries, creation, lookup, and deletion. Project pages can use typed data without handling transport fields.
Project transport mapping must stay aligned with the backend contract. Cover pagination, DTO mapping, writes, deletion, and bearer token injection. Contract regressions fail before reaching the project pages.
The asset library needs the persisted character hierarchy from PR 75. Map character, outfit, action, and frame data with complete tree updates. Pages can browse formal assets without generated or mock-only fields.
Character tree mapping carries the core project asset contract. Cover list, detail, create, update, delete, and token-aware requests. Nested asset serialization remains protected by executable tests.
Pages consume entities through the layer public entry point. Export the implemented project and character APIs with their domain types. Project pages keep respecting the existing dependency boundary.
Backend project and character lists can span multiple pages. Add a business-neutral pagination control and export it from shared UI. List pages can navigate all records without duplicating controls.
Projects need an entry page and a persistent project-level workspace. Implement paged project browsing, deletion, navigation, and project constraints. Users can enter one project before managing its contained assets.
Project assets need formal browsing below the project workspace. Implement character cards, outfit selection, stacked actions, and frame expansion. The UI reflects only fields persisted by the character contract.
Project pages require a nested route boundary outside the global shell. Mount the asset library and character detail beneath the project workspace. Direct routes preserve project context without duplicating global navigation.
Project navigation currently changes state without visual continuity. Add restrained entry, route, dialog, and card transitions with reduced motion. Page changes remain legible without changing the established palette.
Page tests need realistic HTTP responses without production mock data. Provide a test-only Project and Character backend with configurable pagination. Production bundles remain independent from demonstration fixtures.
Project entry and workspace behavior need route-level regression coverage. Cover real HTTP data, deletion, pagination, constraints, and disabled boundaries. The project navigation flow remains verifiable without browser fixtures.
Asset browsing must preserve project ownership and frame ordering. Cover pagination, empty states, outfits, stacked actions, and frame expansion. Unsupported template and export actions stay explicit and inert.
The architecture documents still describe project pages as placeholders. Record the formal workspace, backend mappings, merge order, and excluded flows. Reviewers can distinguish current behavior from backend and future work.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Keep the project workspace usable when the optional character count request is unavailable. Load the project and character count with Promise.allSettled, preserving project errors while applying the count only on success. Add a regression test for a failed character-list request.
集成验证:本 PR 的只读链路已在真实后端上跑通,附三条反馈把 跑通的链路:项目列表 → 项目详情 → 资产库 → 角色详情 → 点动作卡展开完整帧序列。帧图全部从对象存储正常加载、无裂图、无白屏、无 pageerror。项目规格(视角/朝向/精灵尺寸/画风)与后端返回一致。 1. 读取链路对帧数没有硬断言,与生成链路不同——建议注释写明生成链路要求「候选图正好 4 张」「动作帧正好 16 帧且 index 连续」,不满足会直接 throw。但读取链路没有这个约束:我特意用一个 20 帧的动作做控制样本,资产页正常显示「攻击 · 12 FPS · 20 帧 · 单次」。 这两条路径的差异建议在代码注释里写清楚,否则容易被误读成「系统只支持 16 帧」,进而在预埋数据、导入既有资产时凑帧数。 2. 组合根缺失,generation / media 两个适配器目前接不上全仓搜 不是本 PR 的责任,但如果没人认领这一层,#110/#111 会一直是编译得过、界面上摸不到的状态。 3. 首页两个主 CTA 指向的路由仍是占位页
建议要么把 CTA 暂时指向本 PR 的项目中心(这是当前唯一走得通的入口),要么在占位页上写清楚"实现在 #95 / #102",避免被当成坏掉了。 |
|
感谢这次真实后端集成验证,三点我们确认如下:
因此这三点不作为 #119 的代码改动,后续按对应 PR / Issue 跟进。 |


实现 Projects 模块的项目中心与项目资产工作区,覆盖项目浏览、项目导航、角色资产库和角色详情,并按真实后端字段展示造型、动作与帧。
Closes #118
Why
main目前只有 Projects 路由骨架,项目、角色和资产层级还不能读取正式数据。Change Description
Project → Character → Outfit → Action → Frame浏览资产。character_data更新。Implementation Approach
entities公共入口调用projectApis与characterApis,snake_case 到 camelCase 的转换留在对应实体模块。/projects/:projectId/*使用独立项目工作区路由,资产库与角色详情保留同一项目上下文。Screenshots
以下截图来自本地接口契约环境。测试数据与图片仅用于页面核对,不进入生产源码或构建产物。
项目中心
角色资产库
角色详情与动作帧
Testing
在本地将本分支与
feat/shared-api-client临时合并且不创建提交,完整门禁通过:npm run format:check:通过,55 个文件。npm run lint:通过。npm run typecheck:通过。npm run test:通过,10 个测试文件、38 项测试。npm run build:通过,Vite 构建 96 个模块。git merge-tree --write-tree HEAD feat/shared-api-client:无冲突。upstream/main,Projects 差异不包含frontend/src/shared/api/*。Follow-ups
Related